public class Main {
    public static void main(String[] args) {
        MyArrayList myArrayList = new MyArrayList();

        //1. 验证add (添加到元素末尾)
        myArrayList.add(1);
        myArrayList.add(1);
        myArrayList.add(2);
        myArrayList.add(3);
        myArrayList.add(4);
        myArrayList.add(5);
        System.out.println(myArrayList);

        //2. 验证 add (添加到指定位置)
        myArrayList.add(2,99);
        System.out.println(myArrayList);

        //3. 验证 remove (根据值删除元素)
        myArrayList.remove(2);
        System.out.println(myArrayList);

        //4. 验证 remove (根据下标删除元素)
        myArrayList.removeIndex(1);
        System.out.println(myArrayList);

        //5. 验证 contains
        System.out.println(myArrayList.contains(99));

        //6. 验证 isEmpty() 和 clear()
        System.out.println(myArrayList.isEmpty());
        myArrayList.clear();
        System.out.println(myArrayList.isEmpty());
    }
}
